import type { Data, TableDataInfo } from '@/types/global'
import type { Avatar, UserDto } from '@/types/my'
import { http } from '@/utils/http'

/**
 * 获取头像列表
 * @returns
 */
export const getAvatarListAPI = () => {
  return http<TableDataInfo<Avatar>>({
    url: `/avatar/list`,
    method: 'GET',
  })
}

/**
 * 修改用户信息
 * @param data
 * @returns
 */
export const putUserAPI = (data: UserDto) => {
  return http<Data<number>>({
    url: `/user`,
    method: 'PUT',
    data,
  })
}
